

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class FMBottomButton extends StatelessWidget {

  final GestureTapCallback? onTap;

  final String title;

  final double height;

  final String imageName;

  const FMBottomButton({
    super.key,
    required this.title,
    this.onTap,
    this.height = 46,
    this.imageName = 'assets/launch/button_black_bg.png'
  });

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        height: height,
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage(imageName),
            fit: BoxFit.cover, // 可选的填充方式
          ),
        ),
        child: Center(
          child: Text(
            title,
            style: const TextStyle(
              fontSize: 18,
              fontWeight: FontWeight.bold,
              color: Colors.white,
              decoration: TextDecoration.none,
            ),
          ),
        ),
      ),
    );
  }
}
